#include <iostream>
using namespace std;
int main(){
    int n, m, k;
    cin>>n>>m>>k;
    int Q[200002] = {0};
    for (int i = 0; i < n; ++i) {
        int t, c;
        cin>>t>>c;
        int l = max(0, t - k - c + 1);
        int r = max(0, t - k);
        ++Q[l];
        --Q[r + 1];
    }
    for (int i = 1; i < 200002; ++i)Q[i] += Q[i - 1];
    for (int i = 0; i < m; ++i) {
        int q;
        cin>>q;
        cout<<Q[q]<<endl;
    }
    return 0;
}


